package vivek.project.pocketmoney.stocks.model.utils
{
	import mx.collections.ArrayCollection;
	import vivek.project.pocketmoney.stocks.model.StockDataCache;

	public class StockPriceUpdate
	{
		public function updateAllStockPrices():void
		{
			var stockObj:Object=new Object();
			var allStocksList:ArrayCollection=StockDataCache.stockList;
			{
				for each (stockObj in allStocksList)
				{
					new StockPriceUpdateWorker(stockObj);
						//getStockPrice(stockObj.sc_stockname,stockObj.sc_stocktype,stockObj.sc_id)
				}
				for each (stockObj in StockDataCache.stockIndices)
				{
					new StockPriceUpdateWorker(stockObj);
						//getStockPrice(stockObj.sc_stockname,stockObj.sc_stocktype,stockObj.sc_id)
				}
			/*var bseObject:Object=new Object();
			   bseObject.sc_stocktype=1;
			   bseObject.sc_stockname="SENSEX";
			 new StockPriceUpdateWorker( bseObject);*/
			}
		}
		public function updateStockPrices():void
		{
			var stockObj:Object=new Object();
			var stockWatchList:ArrayCollection=StockDataCache.stockWatchList;
			{
				for each (stockObj in stockWatchList)
				{
					new StockPriceUpdateWorker(stockObj);
						//getStockPrice(stockObj.sc_stockname,stockObj.sc_stocktype,stockObj.sc_id)
				}
				for each (stockObj in StockDataCache.stockIndices)
				{
					new StockPriceUpdateWorker(stockObj);
						//getStockPrice(stockObj.sc_stockname,stockObj.sc_stocktype,stockObj.sc_id)
				}
			/*var bseObject:Object=new Object();
			   bseObject.sc_stocktype=1;
			   bseObject.sc_stockname="SENSEX";
			 new StockPriceUpdateWorker( bseObject);*/
			}
		}
	}
}